package org.come.login;

import org.come.until.MessagrFlagUntil;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

public class CreateMouslisten implements MouseListener {

	private int i;
	private SpriteBtn btn;
	private LoginJpanel loginJpanel;

	//0"记住账号" 1"密码保护" 2"注册" 3"改密" 4"下拉" 5"登录"  6"立即注册"
	public CreateMouslisten(int i, SpriteBtn btn,LoginJpanel loginJpanel) {
		super();
		this.i = i;
		this.btn = btn;
		this.loginJpanel=loginJpanel;
	}
	@Override
	public void mouseClicked(MouseEvent e) {
		// TODO Auto-generated method stub

	}
	@Override
	public void mousePressed(MouseEvent e) {
		// 点击
		if (btn.isChoose()) {
			if (btn.getZhen() != 2) {// 选择类 选中
				btn.btn(2);
				loginJpanel.getCreateView().xzRole(i);
			} else {
				// 选择类 取消选中
				btn.btn(0);
			}
		} else {
			btn.btn(2);
		}
	}
	@Override
	public void mouseReleased(MouseEvent e) {
		// TODO Auto-generated method stub
		// 鼠标释放
		if (!btn.isChoose()) {// 非选择类生效
			btn.btn(0);
		}
	}
	@Override
	public void mouseEntered(MouseEvent e) {
		MessagrFlagUntil.setMouse(MessagrFlagUntil.MOUSE12);
		// TODO Auto-generated method stub
		if (btn.getZhen() != 2) {
			btn.btn(1);
		}
	}
	@Override
	public void mouseExited(MouseEvent e) {
		MessagrFlagUntil.setMouse(MessagrFlagUntil.MOUSE1);
		// TODO Auto-generated method stub
		if (btn.getZhen() != 2) {
			btn.btn(0);
		}
	}
}
